﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CharacterInven.aspx.cs" Inherits="_2011DBProject.CharacterInven" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link rel=StyleSheet HREF='design1.css' type='text/css'>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>새벽 골프</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
            <p align =left>
        <asp:Button ID="btnGoLogout" runat="server" onclick="btnGoLogout_onclick" 
            Text="☜ 로 그 아 웃" Width="150px" />
        <asp:Button ID="btnGoServer" runat="server" onclick="btnGoServer_onclick" 
            Text="☜ 서 버 선 택" Width="150px" />
        <asp:Button ID="btnGoCharacter" runat="server" onclick="btnGoCharacter_onclick" 
            Text="☜ 캐 릭 선 택" Width="150px" />
        <asp:Button ID="btnGoChannel" runat="server" onclick="btnGoChannel_onclick" 
            Text="☜ 채 널 선 택" Width="150px" />
        <asp:Button ID="btnGoMain" runat="server" onclick="btnGoMain_onclick" 
            Text="☜ 메 인 화 면" Width="150px" />
        </p>
        <br />
        <br />
            <asp:Label ID="Label1" runat="server" Font-Size="25pt" 
            ForeColor="#9EDCFF" Text="캐릭터가 착용중인 아이템"></asp:Label>
            <br />
        <br />
        <asp:GridView ID="dvMyItem" runat="server" 
            AutoGenerateColumns="False" CellPadding="4" 
            DataKeyNames="ITEM_NO,INVEN_ITEM_UNIQ_NO" 
            DataSourceID="sqldsMyItem" 
            EmptyDataText="There are no data records to display." ForeColor="#333333" 
            GridLines="None" style="text-align: center" 
            onselectedindexchanged="dvMyItem_SelectedIndexChanged" 
                HorizontalAlign="Center">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="ITEM_NO" HeaderText="아이템번호" 
                    SortExpression="ITEM_NO" />
                <asp:BoundField DataField="ITEM_NAME" HeaderText="아이템 이름" 
                    SortExpression="ITEM_NAME" >
                <HeaderStyle Width="200px" />
                </asp:BoundField>
                <asp:BoundField DataField="DURABILITY" HeaderText="내구도" 
                    SortExpression="DURABILITY" />
                <asp:BoundField DataField="POWER_CORRECTION" HeaderText="+파워" 
                    SortExpression="POWER_CORRECTION" />
                <asp:BoundField DataField="IMPACT_CORRECTION" HeaderText="+임팩트" 
                    SortExpression="IMPACT_CORRECTION" />
                <asp:BoundField DataField="TECHNIQUE_CORRECTION" HeaderText="+기술" 
                    SortExpression="TECHNIQUE_CORRECTION" />
                <asp:BoundField DataField="STRENGTH_CORRECTION" 
                    HeaderText="+체력" SortExpression="STRENGTH_CORRECTION" />
                <asp:BoundField DataField="INVEN_ITEM_UNIQ_NO" 
                    HeaderText="구별번호" SortExpression="INVEN_ITEM_UNIQ_NO" />
                <asp:BoundField DataField="QTY" HeaderText="수량" 
                    SortExpression="QTY" />
                <asp:BoundField DataField="DETAIL_DESCRIPTION" 
                    HeaderText="종류" SortExpression="DETAIL_DESCRIPTION" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <br />
                <font color="#ffff99">착용중인 아이템이 없습니다.</font><br />
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <br />
        <asp:SqlDataSource ID="sqldsMyItem" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM &quot;MY_ITEM&quot; WHERE &quot;CHARACTER_NAME&quot; = :CHARACTER_NAME AND &quot;SERVER_NO&quot; = :SERVER_NO AND &quot;ITEM_NO&quot; = :ITEM_NO AND &quot;INVEN_ITEM_UNIQ_NO&quot; = :INVEN_ITEM_UNIQ_NO" 
            InsertCommand="INSERT INTO &quot;MY_ITEM&quot; (&quot;CHARACTER_NAME&quot;, &quot;SERVER_NO&quot;, &quot;ITEM_NO&quot;, &quot;DURABILITY&quot;, &quot;POWER_CORRECTION&quot;, &quot;IMPACT_CORRECTION&quot;, &quot;TECHNIQUE_CORRECTION&quot;, &quot;STRENGTH_CORRECTION&quot;, &quot;CADDIE_EQUIP&quot;, &quot;CHARACTER_EQUIP&quot;, &quot;INVEN_ITEM_UNIQ_NO&quot;, &quot;LOCKERROOM_KEEP&quot;, &quot;QTY&quot;) VALUES (:CHARACTER_NAME, :SERVER_NO, :ITEM_NO, :DURABILITY, :POWER_CORRECTION, :IMPACT_CORRECTION, :TECHNIQUE_CORRECTION, :STRENGTH_CORRECTION, :CADDIE_EQUIP, :CHARACTER_EQUIP, :INVEN_ITEM_UNIQ_NO, :LOCKERROOM_KEEP, :QTY)" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT MY_ITEM.ITEM_NO, MY_ITEM.CHARACTER_NAME, MY_ITEM.DURABILITY, MY_ITEM.POWER_CORRECTION, MY_ITEM.IMPACT_CORRECTION, MY_ITEM.TECHNIQUE_CORRECTION, MY_ITEM.STRENGTH_CORRECTION, MY_ITEM.CADDIE_EQUIP, MY_ITEM.CHARACTER_EQUIP, MY_ITEM.INVEN_ITEM_UNIQ_NO, MY_ITEM.LOCKERROOM_KEEP, MY_ITEM.QTY, ITEM.ITEM_NAME, CODE_DETAIL.DETAIL_DESCRIPTION, CODE.CATEGORY_DESCRIPTION, CODE.CODE_CATEGORY, CODE_DETAIL.CODE_CATEGORY AS EXPR1, CODE_DETAIL.CODE FROM ITEM, MY_ITEM, CODE_DETAIL, CODE WHERE ITEM.ITEM_NO = MY_ITEM.ITEM_NO AND ITEM.ITEM_CODE = CODE_DETAIL.CODE AND ITEM.ITEM_CODE_CAT = CODE.CODE_CATEGORY AND CODE_DETAIL.CODE_CATEGORY = CODE.CODE_CATEGORY AND (MY_ITEM.SERVER_NO = :SERVER_NO) AND (MY_ITEM.CHARACTER_NAME = :CHARACTER_NAME) AND (MY_ITEM.CADDIE_EQUIP = 'N') AND (MY_ITEM.CHARACTER_EQUIP = 'Y') AND (MY_ITEM.LOCKERROOM_KEEP = 'N')" 
            
            
            
            
                UpdateCommand="UPDATE &quot;MY_ITEM&quot; SET &quot;DURABILITY&quot; = :DURABILITY, &quot;POWER_CORRECTION&quot; = :POWER_CORRECTION, &quot;IMPACT_CORRECTION&quot; = :IMPACT_CORRECTION, &quot;TECHNIQUE_CORRECTION&quot; = :TECHNIQUE_CORRECTION, &quot;STRENGTH_CORRECTION&quot; = :STRENGTH_CORRECTION, &quot;CADDIE_EQUIP&quot; = :CADDIE_EQUIP, &quot;CHARACTER_EQUIP&quot; = :CHARACTER_EQUIP, &quot;LOCKERROOM_KEEP&quot; = :LOCKERROOM_KEEP, &quot;QTY&quot; = :QTY WHERE &quot;CHARACTER_NAME&quot; = :CHARACTER_NAME AND &quot;SERVER_NO&quot; = :SERVER_NO AND &quot;ITEM_NO&quot; = :ITEM_NO AND &quot;INVEN_ITEM_UNIQ_NO&quot; = :INVEN_ITEM_UNIQ_NO">
            <SelectParameters>
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" />
                <asp:SessionParameter Name="CHARACTER_NAME" SessionField="CHARACTER_NAME" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="CHARACTER_NAME" Type="String" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="ITEM_NO" Type="Decimal" />
                <asp:Parameter Name="INVEN_ITEM_UNIQ_NO" Type="Decimal" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="CHARACTER_NAME" Type="String" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="ITEM_NO" Type="Decimal" />
                <asp:Parameter Name="DURABILITY" Type="Decimal" />
                <asp:Parameter Name="POWER_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="IMPACT_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="TECHNIQUE_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="STRENGTH_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="CADDIE_EQUIP" Type="String" />
                <asp:Parameter Name="CHARACTER_EQUIP" Type="String" />
                <asp:Parameter Name="INVEN_ITEM_UNIQ_NO" Type="Decimal" />
                <asp:Parameter Name="LOCKERROOM_KEEP" Type="String" />
                <asp:Parameter Name="QTY" Type="Decimal" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="DURABILITY" Type="Decimal" />
                <asp:Parameter Name="POWER_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="IMPACT_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="TECHNIQUE_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="STRENGTH_CORRECTION" Type="Decimal" />
                <asp:Parameter Name="CADDIE_EQUIP" Type="String" />
                <asp:Parameter Name="CHARACTER_EQUIP" Type="String" />
                <asp:Parameter Name="LOCKERROOM_KEEP" Type="String" />
                <asp:Parameter Name="QTY" Type="Decimal" />
                <asp:Parameter Name="CHARACTER_NAME" Type="String" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="ITEM_NO" Type="Decimal" />
                <asp:Parameter Name="INVEN_ITEM_UNIQ_NO" Type="Decimal" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
        <br />
        <br />
        <asp:Label ID="lblUnique" runat="server" Text="Label" Visible="False"></asp:Label>
        <asp:Label ID="lblItem" runat="server" Text="선택된 아이템이 없습니다."></asp:Label>
        <br />
        <br />
        <asp:Button ID="btnTakeOff" runat="server" onclick="btnApplyToCharacter_Click" 
            Text="착용해제" />
    
    </div>
    </form>
</body>
</html>
